<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>layui实战</title>
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <script src="../../layui/layui.js"></script>
</head>
<body>
<div class="layui-container">
  <table id="demo" lay-filter="test"></table>
  <button id="button1" type="button" class="layui-btn layui-btn-fluid">流体按钮（最大化适应）</button>
  <script src="/common/layui/layui.js"></script>
  <script>
    layui.use(['table','layer'], function(){

      var table = layui.table;
      var layer = layui.layer;
      var $ = layui.jquery;



      $("#button1").click(function () {
        layer.open({
          type: 2,
          content: "Test1.html" ,//这里content是一个普通的String
          area:['500px','500px'],
        });
      });

      //第一个实例
      table.render({
        elem: '#demo'
        ,height: 312
        ,url: "user.js" //数据接口
        ,page: true //开启分页
        ,cols: [[ //表头
          {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
          ,{field: 'username', title: '用户名', width:80}
          ,{field: 'sex', title: '性别', width:80, sort: true}
          ,{field: 'city', title: '城市', width:80}
          ,{field: 'sign', title: '签名', width: 177}
          ,{field: 'experience', title: '积分', width: 80, sort: true}
          ,{field: 'score', title: '评分', width: 80, sort: true}
          ,{field: 'classify', title: '职业', width: 80}
          ,{field: 'wealth', title: '财富', width: 135, sort: true}
        ]]
      });

    });
  </script>


</div>



</body>
</html>